package com.jinandi.app.domain;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * <角色和资源关系>
 * @author CGC
 * @version [记录版本号, 2013-5-8]
 */
@Entity
@Table(name = "JND_AUTHORITANDRES")
public class AuthoritAndRes extends ManagedIdentityDomainObject<AuthoritAndRes> {

	private static final long serialVersionUID = 650925137395920301L;

	private Resource resource; // 关联用户id

	private Authorit authorit; // 关联权限id

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "res_id",nullable = false)
	public Resource getResource() {
		return resource;
	}

	public void setResource(Resource resource) {
		this.resource = resource;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "authorit_id",nullable = false)
	public Authorit getAuthorit() {
		return authorit;
	}

	public void setAuthorit(Authorit authorit) {
		this.authorit = authorit;
	}

}
